package czh.cocoa.ui;

import czh.cocoa.foundation.NSObject;
import czh.cocoa.foundation.NSSet;

public class UIEvent extends NSObject {

	private NSSet mTouches;
	
	public UIEvent(NSSet touches) {
		mTouches = touches;
	}
	
	public NSSet allTouches() {
		return mTouches;
	}
	
	//additional
	public UITouch touchAtPointerIndex(int index) {
		for (NSObject t : mTouches) {
			UITouch touch = (UITouch) t;
			if (touch.pointerIndex() == index) {
				return touch;
			}
		}
		return null;
	}
	
	
	//additional
	public UITouch firstTouch() {
		return touchAtPointerIndex(0);
	}
	
	
	
}
